﻿Imports BUS
Imports DTO

Public Class ThemPhong

    Private Sub btnHuyBo_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnHuyBo.Click
        Me.Close()
    End Sub

    Private Sub ThemPhong_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Load Loai Phong
        Dim bus As New LoaiPhongBUS()
        cbbLoaiPhong.DataSource = bus.HienThiLoaiPhong()
        cbbLoaiPhong.DisplayMember = "TenLoaiPhong"
        cbbLoaiPhong.ValueMember = "MaLoaiPhong"


        'Load cac phong hien tai
        Dim busPhong As New PhongBUS()
        Dim dsPhong As New List(Of PhongDTO)
        dsPhong = busPhong.HienThiDanhSachPhong()


        For i As Integer = 0 To dsPhong.Count - 1
            dtgv_DanhSachPhong.Rows.Add(dsPhong(i).TenPhong, dsPhong(i).TenLoaiPhong, dsPhong(i).TenTinhTrang, dsPhong(i).GhiChu, dsPhong(i).GiaPhong)
        Next




        'for--> dgvDSP.add(dsPhong(i).TenCN, dsPhong(i).TenLoaiPhong)
    End Sub


    'THÊM PHÒNG MỚI
    Private Sub btnThem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnThem.Click
        'dùng kết nối

        Dim phong As New PhongDTO()
        phong.TenPhong = txtTenPhong.Text
        phong.TenLoaiPhong = cbbLoaiPhong.SelectedValue
        phong.GhiChu = txtGhiChu.Text


    End Sub
End Class